package geppetto.phraseTable.prunning.local;

import geppetto.phraseHMM.phraseExtraction.extractedphrase.ExtractedPhrasePairData;
import geppetto.phraseHMM.phraseExtraction.extractedphrase.data.SubPathsData;
import geppetto.phraseTable.phrase.Phrase;

import java.util.HashMap;

public class SubPhrasesPrunner extends AbstractPhrasePrunner{

	protected final static String SUB_PATHS = "sub_paths";
	protected double threshold;

	public SubPhrasesPrunner(double threshold) {
		super();
		this.threshold = threshold;
	}

	@Override
	public boolean shouldPruneEntry(Phrase p) {
		double subpaths = ((SubPathsData)p.getData(SUB_PATHS)).getSubpaths();
		return subpaths > threshold;
	}

}
